//
//  LTView.m
//  CoreData通讯录
//
//  Created by 邝子涵 on 15/11/21.
//  Copyright © 2015年 kuangzihan. All rights reserved.
//

#import "LTView.h"

@implementation LTView
// 重写初始化方法
- (instancetype)initWithFrame:(CGRect)frame
{
    self = [super initWithFrame:frame];
    if (self) {
        // 创建label和textField
        [self createView];
    }
    return self;
}

- (void)createView{
    
    // 创建Lable并贴在ltview上
    self.myLabel = [[UILabel alloc] initWithFrame:CGRectMake(20, 20, 80, 30)];
    self.myLabel.textAlignment = NSTextAlignmentCenter;
    // 把lable贴在LTView上
    [self addSubview:self.myLabel];
    
    
    // 把TextField贴在ltview上
    self.myTextField = [[UITextField alloc] initWithFrame:CGRectMake(110, 20, 240, 30)];
    self.myTextField.layer.borderWidth = 1;
    self.myTextField.layer.cornerRadius = 5;
    [self addSubview:self.myTextField];
    
    
}

@end
